package com.bruce.principle.demeter.demo;

import java.util.ArrayList;
import java.util.List;

/**
 * <pre>
 *   Boss类中不需要关注Course课程,只需要告诉TeamLeader需要知道有多少课程
 *   但是boss类中却引入了Course类,不符合迪米特原则,改进看demo2
 * </pre>
 * Created by bruce on 2018/10/23 22:46
 */
public class Boss {

    public void commandCheckNumber(TeamLeader teamLeader){
        //模仿查询数据库
        List<Course> courses = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            courses.add(new Course());
        }
        teamLeader.commandCheckNumber(courses);
    }





}
